<include file="./Tpl/Admin/header.html" />
<div class="main">
	<div class="main_title">
		<img src="/Public/Admin/images/book1.gif"/>&nbsp;&nbsp;币种管理
	</div>
	<eq name="module" value="list">
	<div class="list_body">
	    <form action="?s=Admin/Type/delAll" method="post" id="formid">
		<table cellspacing=0 cellpadding=0 border=0>
		    <tr>
			   <th width="5%">选择</th><th width="10%">币种名称</th><th width="10%">币种简称</th><th width="5%">排序</th><th width="5%">卖出上限</th><th width="5%">卖出下限</th><th width="5%">买入下限</th><th width="5%">涨停幅度</th><th width="5%">跌停幅度</th><th width="10%">操作</th>
			</tr>
			<volist name="list" id="vo">
			<tr>
			   <td><input type="checkbox" class="id" name="id[]" value="{$vo.id}"></td><td>{$vo.name}</td><td>{$vo.nickname}</td><td>{$vo.sort}</td><td>{$vo.sellmax}</td><td>{$vo.sellmin}</td><td>{$vo.buymin}</td><td>{$vo.up} %</td><td>{$vo.down} %</td><td><a href="?s=Admin/Type/set/id/{$vo.id}">修改</a>&nbsp;&nbsp;<a href="?s=Admin/Type/del/id/{$vo.id}">删除</a></td>
			</tr>
			</volist>
			<tr>
			    <td colspan=10 class="page">
				    <input type="button" id="all" value=" 全选 ">
					<input type="button" id="all_return" value=" 全不选 ">
					<input type="button" id="dels" value=" 批量删除 ">
					<input type="button" id="add" value=" 添加新币种 ">
					<a href="?s=Admin/Type/index/page/1">首页</a>
					<a href="?s=Admin/Type/index/page/{$page-1}">上一页</a>
					<a href="?s=Admin/Type/index/page/{$page+1}">下一页</a>
					<a href="?s=Admin/Type/index/page/{$page_num}">尾页</a>
                </td>
			</tr>
		</table>
		</form>
	</div>
	<else/>
	<div class="main_body">
		<form action="?s=Admin/Type/update" method="post">
		<input type="hidden" name="id" value="{$id}"/>
		<table cellspacing=0 cellpadding=0 border=0>
		<tr><td>币种名称</td><td><input type="text" name="name" value="{$name}"/></td></tr>
		<tr><td>币种简称</td><td><input type="text" name="nickname" value="{$nickname}"/></td></tr>
		<tr>
			<td>币种简介</td>
			<td>
				<textarea name="info" cols=50 rows=10>{$info}</textarea>
			</td>
		</tr>
		<tr><td>本站币</td><td><input type="radio" name="main" value="1" <eq name="main" value="1">checked</eq>/>是 <input type="radio" name="main" value="0" <eq name="main" value="0">checked</eq>/>否&nbsp;&nbsp;&nbsp;&nbsp;<font color=red>网站自己的币选择 “是”</font></td></tr>
		<tr><td>币种属性</td><td><input type="radio" name="yuan" value="1" <eq name="yuan" value="1">checked</eq>/>人民币 <input type="radio" name="yuan" value="0" <eq name="yuan" value="0">checked</eq>/>虚拟币</td></tr>
		<tr><td>排序</td><td><input type="text" name="sort" value="{$sort|default=0}"/></td></tr>
		<tr><td>卖出上限</td><td><input type="text" name="sellmax" value="{$sellmax|default=0}"/></td></tr>
		<tr><td>卖出下限</td><td><input type="text" name="sellmin" value="{$sellmin|default=0}"/></td></tr>
		<tr><td>买入下限</td><td><input type="text" name="buymin" value="{$buymin|default=0}"/></td></tr>
		<tr><td>涨停幅度</td><td><input type="text" name="up" value="{$up|default=0}"/> %</td></tr>
		<tr><td>跌停幅度</td><td><input type="text" name="down" value="{$down|default=0}"/> %</td></tr>
		<tr><td>服务器地址</td><td><input type="text" name="url" value="{$url}"/></td></tr>
		<tr><td>服务器端口</td><td><input type="text" name="port" value="{$port}"/></td></tr>
		<tr><td>用户名</td><td><input type="text" name="username" value="{$username}"/></td></tr>
		<tr><td>密码</td><td><input type="text" name="password" value="{$password}"/></td></tr>
		<tr><td>分红截至时间</td><td><input type="text" name="divday" value="{$divday|default=0}"/> 天</td></tr>
		<tr><td>日分红比率</td><td><input type="text" name="divrates" value="{$divrates|default=0}"/> %</td></tr>
		</table>
		<div><input type="submit" value="提交"/></div>
		</form>
    </div>
	</eq>
</div>
<include file="./Tpl/Admin/footer.html" />
<script language="javascript">
$(document).ready(function(){
    $('#all').click(function(){
	    $('.id').attr('checked',true);
	});
	$('#all_return').click(function(){
	    $('.id').attr('checked',false);
	});
    $('#dels').click(function(){

		f = 0;
	    $('.id').each(function(){
		    if($(this).attr('checked')) f = 1;
		});
		
        if(f==0){
		    alert('请选择要删除的项！');
		}else{
		    $('#formid').submit();
		}
	});
	$('#add').click(function(){
	    location.href="?s=Admin/Type/add";
	});


});
</script>